/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import util.InterfaceUtente;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author grillo
 */
@Entity
@Table(name = "segreteria")
@NamedQueries({@NamedQuery(name = "Segreteria.findAll", query = "SELECT s FROM Segreteria s"), @NamedQuery(name = "Segreteria.findByMatricola", query = "SELECT s FROM Segreteria s WHERE s.matricola = :matricola"), @NamedQuery(name = "Segreteria.findByNome", query = "SELECT s FROM Segreteria s WHERE s.nome = :nome"), @NamedQuery(name = "Segreteria.findByCognome", query = "SELECT s FROM Segreteria s WHERE s.cognome = :cognome"), @NamedQuery(name = "Segreteria.login", query = "SELECT u FROM Segreteria u WHERE u.matricola = :matricola AND u.password = :password"), @NamedQuery(name = "Segreteria.findByIndirizzo", query = "SELECT s FROM Segreteria s WHERE s.indirizzo = :indirizzo"), @NamedQuery(name = "Segreteria.findByTelefono", query = "SELECT s FROM Segreteria s WHERE s.telefono = :telefono"), @NamedQuery(name = "Segreteria.findByMail", query = "SELECT s FROM Segreteria s WHERE s.mail = :mail"), @NamedQuery(name = "Segreteria.findByImg", query = "SELECT s FROM Segreteria s WHERE s.img = :img")})
public class Segreteria implements Serializable, InterfaceUtente {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "matricola")
    private Integer matricola;
    @Basic(optional = false)
    @Column(name = "nome")
    private String nome;
    @Basic(optional = false)
    @Column(name = "cognome")
    private String cognome;
    @Basic(optional = false)
    @Column(name = "password")
    private String password;
    @Column(name = "indirizzo")
    private String indirizzo;
    @Column(name = "telefono")
    private String telefono;
    @Column(name = "mail")
    private String mail;
    @Column(name = "img")
    private String img;

    public Segreteria() {
    }

    public Segreteria(Integer matricola) {
        this.matricola = matricola;
    }

    public Segreteria(Integer matricola, String nome, String cognome, String password) {
        this.matricola = matricola;
        this.nome = nome;
        this.cognome = cognome;
        this.password = password;
    }

    public Integer getMatricola() {
        return matricola;
    }

    public void setMatricola(Integer matricola) {
        this.matricola = matricola;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getCognome() {
        return cognome;
    }

    public void setCognome(String cognome) {
        this.cognome = cognome;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getIndirizzo() {
        return indirizzo;
    }

    public void setIndirizzo(String indirizzo) {
        this.indirizzo = indirizzo;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (matricola != null ? matricola.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Segreteria)) {
            return false;
        }
        Segreteria other = (Segreteria) object;
        if ((this.matricola == null && other.matricola != null) || (this.matricola != null && !this.matricola.equals(other.matricola))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Segreteria[matricola=" + matricola + "]";
    }

}
